package com.night.pcard;

import java.util.Calendar;

public class util {

    public static String randomBirthday(int year,int month,int day) {
        Calendar birthday = Calendar.getInstance();
        birthday.set(Calendar.YEAR,year);
        birthday.set(Calendar.MONTH,month);
        birthday.set(Calendar.DATE,day);

        StringBuilder builder = new StringBuilder();
        builder.append(birthday.get(Calendar.YEAR));
        long lmonth = birthday.get(Calendar.MONTH) + 1;
        if (month < 10) {
            builder.append("0");
        }
        builder.append(lmonth);
        long date = birthday.get(Calendar.DATE);
        if (date < 10) {
            builder.append("0");
        }
        builder.append(date);
        return builder.toString();
    }
    
    public static int pdSex(String pcard) {
    	
    	char[] p = pcard.toCharArray();
    	
    	int num;
    	if(p[17]=='X') {
    		num=10;
    	}
    	else {
    		num=p[17]-48;
    	}
    	
    	return num%2==1?1:0;
    	
    }
}
